import React from 'react';
import WeUI from 'react-weui';

//import styles

const {Button} = WeUI;

const btnArea = {
    height:'4.8rem',
    lineHeight:'4.8rem',
    position: 'fixed',
    width: '100%',
    borderRadius: '0px',
    background: '#0088EC',
    bottom: 0,
    left: 0,
    zIndex:2,
}, btn = {
    color: '#FFF',
    borderRadius: '0px',
    outline: 'none',
    border: '1px solid #0088EC',
    backgroundColor:'#0088EC'
};


export default class ConfirmBtn extends React.Component {

    click(){
        // alert("正在建设中...");
        return;
    }

    render() {
        let {btnTitle, func, freeStyle} = this.props;
        if(!func) {
            func = this.click;
        }
        if(freeStyle) {
            Objects.assign(btn, freeStyle);
        }
        return (
            <div>
                <div style={{height:'9.6rem', lineHeight:'9.6rem'}}></div>
                <div style={btnArea}>
                    <Button plain style={btn} onTouchStart={func}>{btnTitle}</Button>
                </div>
            </div>
        );
    }
};

ConfirmBtn.defaultProps = {
    btnTitle : "选好了",
};

ConfirmBtn.propTypes = {
    func : React.PropTypes.func,
    btnTitle : React.PropTypes.string,
};